package system.eventBuffer;

import java.util.Queue;
import java.util.concurrent.ArrayBlockingQueue;

import system.events.Event;

public class EventBuffer {
	private Queue<Event> eventBuffer;

	public EventBuffer() {
		eventBuffer = new ArrayBlockingQueue<Event>(100000);
	}

	public boolean offer(Event event) {
		if (eventBuffer.size() < 100000) {
			eventBuffer.offer(event);
			return true;
		} else {
			return false;
		}

	}

	public Event poll() {
		return eventBuffer.poll();
	}

	public int getSize() {
		return eventBuffer.size();
	}
}
